Re-read assistant definition from disk on editing#8091
Conversation
Code ReviewSummary: Adds a Findings:
Recommendation: improve needed -- The core idea is sound and the change is small, but the unnecessary |
…back in refreshAssistants (janhq#8091) - Add loading:true at start of refreshAssistants (matching pattern in other hooks) - Replace console.error with toast.error for user-facing error feedback - Replace useEffect-derived state with inline computed initialData - Add ref-based request ID guard to handleEditClick to prevent race conditions - Add unit tests for refreshAssistants: fetch success, loading:true timing, toast on failure Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…back in refreshAssistants (janhq#8091) - Add loading:true at start of refreshAssistants (matching pattern in other hooks) - Replace console.error with toast.error for user-facing error feedback - Replace useEffect-derived state with inline computed initialData - Add ref-based request ID guard to handleEditClick to prevent race conditions - Add unit tests for refreshAssistants: fetch success, loading:true timing, toast on failure Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
d760896 to
18e37d8
Compare
Follow-up Review (2026-04-28)All five concerns from the initial review have been addressed:
Minor nits (non-blocking)
Both are minor and can be addressed in a follow-up. Recommendation: can merge |
Follow-up Review (2026-04-29)Reviewing new commit
Code review of the new commitBoth changes are minimal and correct:
No new issues introduced. The PR is clean and all previously raised concerns have been fully addressed across the three follow-up commits. Recommendation: can merge |
|
Any other feedback for this? Can this land or is there opposition? |
Review: feat: re-read agent definition from disk on editingSummary: Adds a Positive observations
Issues and observations
Prior review statusI see this PR has gone through two prior review rounds and all feedback was addressed. The author is asking if it can land. Recommendation: can merge |
…back in refreshAssistants (janhq#8091) - Add loading:true at start of refreshAssistants (matching pattern in other hooks) - Replace console.error with toast.error for user-facing error feedback - Replace useEffect-derived state with inline computed initialData - Add ref-based request ID guard to handleEditClick to prevent race conditions - Add unit tests for refreshAssistants: fetch success, loading:true timing, toast on failure Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
725c20d to
9897ea2
Compare
|
On the feedback points:
/cc @qnixsynapse - You seem to be the prime contact for human attention. Sorry for the direct ping - are we good here? |
Follow-up Review (2026-05-05)Reviewing @sshirokov's responses to our previous review and the latest commit ( Author responses to non-blocking notes
Current state of the codeThe final diff is clean and well-structured:
No new issues. All previously raised concerns have been addressed across the iterative review rounds. The author's pushback on the remaining non-blocking notes is well-reasoned. Recommendation: can merge |
|
cc/ @Minh141120 maybe? 🥺 |
|
Weekly bump 🙏 |
|
@qnixsynapse, @Minh141120 @louis-jan - Can this merge? It fixes a legitimate issue I ran directly into and had been sitting with positive feedback for a few weeks. |
|
Re-pinging: @qnixsynapse @Minh141120 @louis-jan - can this merge or should this close. |
- Added refreshAssistants method to useAssistant hook to fetch fresh data from backend - Modified assistant editing flow to refresh assistants before opening edit dialog - Ensures latest assistant definitions are loaded when editing - Addresses issue where edits might show stale data from previous cache
…back in refreshAssistants (janhq#8091) - Add loading:true at start of refreshAssistants (matching pattern in other hooks) - Replace console.error with toast.error for user-facing error feedback - Replace useEffect-derived state with inline computed initialData - Add ref-based request ID guard to handleEditClick to prevent race conditions - Add unit tests for refreshAssistants: fetch success, loading:true timing, toast on failure Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The sonner mock was defined after vi.mock() which caused "Cannot access mockToast before initialization" due to Vitest's hoisting. Moved all hoisted mocks into vi.hoisted() factory. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
… deps - Add else branch in refreshAssistants to set loading:false on null response, preventing a stuck loading state if getAssistants() returns falsy. - Add refreshAssistants to useCallback deps array with eslint-disable, addressing the exhaustive-deps lint warning (zustand functions are stable). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
beforeEach already calls vi.clearAllMocks(), so the afterEach with mockToast.mockClear() is unnecessary. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
bebc098 to
1d9e1f9
Compare
|
Sometimes, I feel like you're ignoring me on purpose, and it hurts my feelings. |
|
Follow-up review (new activity detected) Since our last detailed review (2026-05-05), new activity includes:
Current stateAll concerns from our initial and follow-up reviews have been addressed across the 5 commits:
The code is clean, well-tested (3 new test cases), and solves a real user-facing issue. The PR has been waiting for maintainer merge approval for over a month. Recommendation: can merge |
|
Status check (2026-06-06) No new commits or code changes since the last review on 2026-06-03. The branch is rebased on Quick recap of the change
Files changed (3)
No outstanding issues. This is a well-scoped, well-tested fix for a real user-facing bug. The author has been patiently waiting for maintainer approval since late April. Recommendation: can merge |
This helps avoid overwriting assistant definition changes if the file containing the definition was edited externally while the UI is open.
Code was AI generated - but human tested for function because it was created to scratch my own itch.
Describe Your Changes
Fixes Issues
N / A
Self Checklist